<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * @fileOverview 공통 > 목록 > 컨텐츠에 마우스오버시 토글(썸네일/세부정보) 처리  
<span class='line'>  3</span>  * @author qpitlove
<span class='line'>  4</span>  */</span><span class="WHIT">
<span class='line'>  5</span> </span><span class="NAME">nhn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.nhn</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  6</span> </span><span class="NAME">nhn.newsstand</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  7</span> </span><span class="NAME">nhn.newsstand.common</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.common</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  8</span> </span><span class="NAME">nhn.newsstand.common.page</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.common.page</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  9</span> </span><span class="NAME">nhn.newsstand.common.page.ContentViewToggler</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$Class</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT">	</span><span class="COMM">/** @lends nhn.newsstand.common.page.ContentViewToggler.prototype */</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 12</span> 	 * nhn.newsstand.common.page.ContentViewToggler 클래스의 인스턴스를 생성한다.  
<span class='line'> 13</span> 	 * @constructs
<span class='line'> 14</span> 	 * @class 공통 > 목록 > 컨텐츠에 마우스오버시 토글(썸네일/세부정보) 처리
<span class='line'> 15</span> 	 * @extends jindo.Component
<span class='line'> 16</span> 	 * @requires nhn.newsstand.common.util
<span class='line'> 17</span> 	 * &lt;br>- 데스크 PC에 대응하여 마우스 오버 시 썸네일 이미지에서 세부 기사 정보를 화면에 표시
<span class='line'> 18</span> 	 * &lt;br>- 태블릿 PC에 대응하여 터치 이벤트 클릭 시 썸네일 이미지에서 세부 기사 정보를 화면에 표시
<span class='line'> 19</span> 	 * @example
<span class='line'> 20</span> &lt;xmp>		
<span class='line'> 21</span> &lt;div class="scrap_lst" style="display:none;">
<span class='line'> 22</span> 	&lt;ul>
<span class='line'> 23</span> 	&lt;li>&lt;div class="_toggleView">
<span class='line'> 24</span> 	&lt;div class="thmb">&lt;a href="#">&lt;img alt="" src="">&lt;/a>&lt;/div>
<span class='line'> 25</span> 	&lt;div style="display: none;" class="dec">...&lt;/div>
<span class='line'> 26</span> 	&lt;/li>
<span class='line'> 27</span> 	&lt;/ul>
<span class='line'> 28</span> &lt;/div>
<span class='line'> 29</span> &lt;script>
<span class='line'> 30</span> var contentViewToggler = new nhn.newsstand.common.page.ContentViewToggler($$.getSingle(".scrap_lst ul"));
<span class='line'> 31</span> &lt;/script>
<span class='line'> 32</span> &lt;/xmp>
<span class='line'> 33</span> 	 */</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">	</span><span class="NAME">$init</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">elContainer</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT">		</span><span class="NAME">this.welContainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="NAME">elContainer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT">		</span><span class="NAME">this._attachHTMLElementEvent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 40</span> 	 * 컨텐츠를 보여줄 때 썸네일 -> 기사 상세로 보여주도록 HTMLElement의 MouseOver/TouchEvent 이벤트 바인딩 처리
<span class='line'> 41</span> 	 * @return {Void} 반환값 없음 
<span class='line'> 42</span> 	 * */</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT">	</span><span class="NAME">_attachHTMLElementEvent</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elBeforeTabletTarget</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bGesture</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oLayerBubbler</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">oUtil.Bubbler</span><span class="PUNC">(</span><span class="NAME">this.welContainer.$value</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oActionHandler</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oUtil.isTabletPC</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">			</span><span class="STRN">"_toggleView:touchstart"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eEvent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aArgs</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">eEvent.$value</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">touches.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">bGesture</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">			</span><span class="STRN">"_toggleView:touchmove"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eEvent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aArgs</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">				</span><span class="NAME">bGesture</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">			</span><span class="STRN">"_toggleView:touchend"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eEvent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aArgs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">				</span><span class="NAME">eEvent.stopDefault</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">bGesture</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">					</span><span class="NAME">bGesture</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">elBeforeTabletTarget</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">					</span><span class="NAME">self.toggleContentThumbView</span><span class="PUNC">(</span><span class="NAME">elBeforeTabletTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">				</span><span class="NAME">self.toggleContentThumbView</span><span class="PUNC">(</span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT">				</span><span class="NAME">elBeforeTabletTarget</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">			</span><span class="STRN">"_toggleView:mouseenter"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eEvent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aArgs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">				</span><span class="NAME">self.toggleContentThumbView</span><span class="PUNC">(</span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">			</span><span class="STRN">"_toggleView:mouseleave"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eEvent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aArgs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">				</span><span class="NAME">self.toggleContentThumbView</span><span class="PUNC">(</span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">		</span><span class="NAME">oLayerBubbler.attach</span><span class="PUNC">(</span><span class="NAME">oActionHandler</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 79</span> 	 * bVisibleThumb의 여부에 따라 해당 기사의 썸네일 or 기사 상세를 보여줄 지 판단
<span class='line'> 80</span> 	 * @param {HTMLElement} elTarget 썸네일 이미지와 기사 상세 영역을 포함하는 랩퍼 영역
<span class='line'> 81</span> 	 * @param {Boolean} bVisibleThumb 썸네일 이미지 혹은 기사 상세 영역을 보여줄 지 여부
<span class='line'> 82</span> 	 *@return {Void} 반환값 없음 
<span class='line'> 83</span> 	 * */</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">	</span><span class="NAME">toggleContentThumbView</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bVisibleThumb</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elThumb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">".thmb"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elDec</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$$.getSingle</span><span class="PUNC">(</span><span class="STRN">".dec"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">		</span><span class="NAME">elThumb.style.display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bVisibleThumb</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">		</span><span class="NAME">elDec.style.display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bVisibleThumb</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">extend</span><span class="PUNC">(</span><span class="NAME">jindo.Component</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>